<?xml version="1.0" encoding="utf-8"?>
<Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:blueonionsoftware-com:bloget:runtime:data">
  <text>Problem: When working in Expression Blend, and double-clicking on an event, a message pops up saying it cannot find the code-behind classes.
Other Symptom: Your .xaml files in Visual Studio have their .cs files nested underneath them, but this is not happening in Expression Blend.
 
Today's little problem came about when I took a heap of code I had been working on and moved it under a new project, using the Add -&gt; Existing Item... from within VS2005.
 
WPF XAML pages consist of two files: the .xaml file and the .cs file behind the XAML.
 
I had a dialog called "ScoringSchemeDialog.xaml" It has a code-behind file called "ScoringSchemeDialog.xaml.cs".
 
Expression Blend is sensitive to the order in which the &amp;lt;Page&gt; and &amp;lt;Compile&gt; directives are placed in the .csproj file. They must appear in this order:
 
    &amp;lt;Compile Include="CardiacWallScoring\ScoringSchemeDialog.xaml.cs"&gt;
      &amp;lt;DependentUpon&gt;ScoringSchemeDialog.xaml&amp;lt;/DependentUpon&gt;
    &amp;lt;/Compile&gt;
    &amp;lt;Page Include="CardiacWallScoring\ScoringSchemeDialog.xaml" /&gt;
 
If the &amp;lt;Page&gt; comes first, then Expression Blend gets confused about where the classes lie. Unfortunately, when you do an Add-&gt;Existing Item... from withing VS2005, the order of these comes out with the &amp;lt;Page&gt; directives first, which messes up Blend's ability to find the classes in the code-behind file.

I rearranged the order of the declarations in the file and it is now working.
</text>
  <last_update>2007-10-04T00:52:37.0690806Z</last_update>
  <source_title />
  <source_link />
  <comments />
  <references />
  <attachments />
</Content>